package com.hackordie.operations.creates;

import com.hackordie.commons.HackOrDieResult;
import com.hackordie.commons.hardware.computer.ComputerType;
import com.hackordie.exceptions.HackOrDieException;
import com.hackordie.operations.AHackOrDieOperationComputerType;

public class CreateComputerType extends AHackOrDieOperationComputerType{

    private ComputerType computerType;
    
    public CreateComputerType(ComputerType computerType) {
        super();
        this.computerType = computerType;
    }

    @Override
    protected boolean checkParameters() {
        // TODO Auto-generated method stub
        return true;
    }

    @Override
    protected HackOrDieResult executeOperation() throws HackOrDieException {
        result.setCorrect(computerTypeDao.create(computerType));
        result.setObject(computerType);
        return result;
    }
}
